#!/bin/sh
# generating PKGBUILD file for Archlinux

GIT_REVISION="${GIT_REVISION:-$(git rev-parse HEAD)}"
GIT_REVSHORT="${GIT_REVSHORT:-$(echo ${GIT_REVISION} | cut -b 1-12)}"
PKG_VERSION="${PKG_VERSION:-$(grep "VERSION = " ../src/__init__.py |
                              cut -d\' -f2)}"

cat << EOF
# Maintainer: Rasmus Thystrup Karstensen <rathka at gmail dot com>
# git-revision: ${GIT_REVISION}
pkgname='metaimage'
pkgver='${PKG_VERSION}'
pkgrel='1'
pkgdesc='Batch-proccessing metadata for image files'
arch=(any)
url='https://code.google.com/p/metaimage'
license=(GPL3)
source=(https://metaimage.googlecode.com/archive/${GIT_REVISION}.tar.gz)
depends=(python python-pytz python-gobject libgexiv2)
md5sums=(SKIP) # zip/tar.gz from google code differs for each download

package() {
  cd \${srcdir}/metaimage-${GIT_REVSHORT}
  sh install.sh \${pkgdir}/usr
}
EOF
